<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->link($this->__('system.button.back'), $this->historyUrl('*/*/*/index')));
echo $t->renderEnd();

$this->nextBlock('form');
$f = $this->modelForm;
echo $f->renderBegin();
echo $f->getFieldById('field_name')->toHtml();
echo $f->getFieldById('field_component_id')->toHtml();
echo $f->getFieldById('field_parent_id')
        ->setInput($this->treeSelect('parent_id', 'model[parent_id]')
                        ->setLabelFormat('<{lang "%s"}>')
                        ->setOption('--', '')
                        ->bindData($this->dataSources['parent_id']['data'], 0, 
                               array('valueKey'=>'id', 'labelKey'=>'name', 'childKey'=>'id', 'parentKey'=>'parent_id')));
echo $f->getFieldById('field_url')->toHtml();
echo $f->getFieldById('field_role_codes')->toHtml();
echo $f->bind($this->hidden('id', 'model[id]'));
echo $f->renderEnd();

$t2 = $this->toolbar();
echo $t2->renderBegin();
echo $t2->renderItem($this->linkButton($this->__('system.button.save'), "submitForm('form')"));
echo $t2->renderEnd();
$this->endBlock();
echo $this->extend('template'.DS.'form');